package com.wnxy.pms.product.core.controller;


import com.wnxy.pms.common.api.Result;
import com.wnxy.pms.common.api.enums.impl.BusinessCode;
import com.wnxy.pms.common.api.enums.impl.ResultCode;
import com.wnxy.pms.product.core.entity.Product;
import com.wnxy.pms.product.core.service.IProductService;
import com.wnxy.pms.product.core.vo.PromotionProductVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 商品表 前端控制器
 * </p>
 *
 * @author Jet
 * @since 2022-06-06
 */
@RestController
@RequestMapping("/product")
@Api(tags = "商品服务")
public class ProductController {

    @Autowired
    private IProductService productService;

    @GetMapping
    @ApiOperation("查询秒杀商品列表")
    public Result<List<PromotionProductVo>> findPromotionSeckill(){
        List<PromotionProductVo> list = productService.findPromotionSeckill();
        return Result.ok(list);
    }
}

